import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    name: 'Home',
    component: () => import(/* webpackChunkName: "home" */ '../views/Home.vue'),
  },
  {
    path: '/vitual-list',
    name: 'vitual-list',
    component: () =>
      import(/* webpackChunkName: "vitual-list" */ '../views/List.vue'),
  },
  {
    path: '/about',
    name: 'About',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/About.vue'),
  },
  {
    path: '/tree',
    name: 'Tree',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Tree.vue'),
  },
  {
    path: '/leaflet-map',
    name: 'LeafletMap',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/LeafletMap.vue'),
  },
  {
    path: '/gantt',
    name: 'Gantt',
    component: () =>
      import(/* webpackChunkName: "about" */ '../views/Gantt.vue'),
  },
  {
    path: '/echarts-demos',
    name: 'EchartsDemos',
    component: () =>
      import(
        /* webpackChunkName: "echarts-demos" */ '../views/EchartsDemos.vue'
      ),
  },
  {
    path: '/zrender',
    name: 'Zrender',
    component: () =>
      import(/* webpackChunkName: "zrender" */ '../views/Zrender.vue'),
  },
  {
    path: '/observer',
    name: 'observer',
    component: () =>
      import(/* webpackChunkName: "observer" */ '../views/Observer.vue'),
  },
  {
    path: '/elec',
    name: 'Elec',
    component: () =>
      import(/* webpackChunkName: "observer" */ '../views/Elec.vue'),
  },
  {
    path: '/vueuse',
    name: 'Vueuse',
    component: () =>
      import(/* webpackChunkName: "Vueuse" */ '../views/Vueuse.vue'),
  },
  {
    path: '/life-circle',
    name: 'LifeCircle',
    component: () =>
      import(/* webpackChunkName: "LifeCircle" */ '../views/LifeCircle.vue'),
  },
  {
    path: '/vue-leaflet',
    name: 'Vue2Leaflet',
    component: () =>
      import(/* webpackChunkName: "Vue2Leaflet" */ '../views/Vue2Leaflet.vue'),
  },
];

const router = new VueRouter({
  mode: window.__POWERED_BY_QIANKUN__ ? 'abstract' : 'history',
  base: '/vue-app',
  routes,
});

export default router;
export { routes };

